package com.cn.gmall.payment.client;

import com.cn.gmall.model.payment.PaymentInfo;
import com.cn.gmall.payment.client.impl.PaymentDegradeFeignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

@FeignClient(value = "service-payment",fallback = PaymentDegradeFeignClient.class )
public interface PaymentFeignClient {

    /**
     * /api/payment/alipay/closePay/{orderId}
     * 给支付宝发请求-->关闭支付支付记录
     * @param orderId
     * @return
     */
    @GetMapping("/api/payment/alipay/closePay/{orderId}")
    @ResponseBody
    public Boolean closePay(@PathVariable Long orderId);

    /**
     * /api/payment/alipay/checkPayment/{orderId}
     * 给支付宝发请求-->查询支付支付记录
     * @param orderId
     * @return
     */
    @GetMapping("/api/payment/alipay/checkPayment/{orderId}")
    @ResponseBody
    public Boolean checkPayment(@PathVariable Long orderId);




    /** /api/payment/alipay/getPaymentInfo/{outTradeNo}
     * 获取支付记录信息(本地存储的订单信息)
     * @param outTradeNo
     * @return
     */
    @GetMapping("/api/payment/alipay/getPaymentInfo/{outTradeNo}")
    @ResponseBody
    public PaymentInfo getPaymentInfo(@PathVariable String outTradeNo);
}
